      SUBROUTINE CTPAK3(KSPEC1,KSPEC2,NPARMS,PARMS,ROTMX,SHIFT,
     *                  LUERR,IERR)
      IMPLICIT REAL*8(A-H,O-Z)
C
C PURPOSE: THIS ROUTINE IS PART OF THE COORDINATE TRANSFORMATION 
C          PACKAGE. IT COMPUTES, VIA CTPAK3A, THE ROTATION AND 
C          TRANSLATION VECTORS NEEDED TO DO THE TRANSFORMATION.
C
C***********************************************************************
C
C BY C PETRUZZO. 10/83, 7/84.
C
C***********************************************************************
C
      REAL*8 PARMS(NPARMS,2)
      INTEGER KSPEC1(3),KSPEC2(3)
      REAL*8 ROTMX(3,3,2),SHIFT(3,2)
C
      LOGICAL NEEDSHIFT,NEEDROT
      REAL*8 IDENT(3,3)/1.D0,3*0.D0,1.D0,3*0.D0,1.D0/
C
C
      IBUG=0
      LUBUG=19
C
C   GET THE MATRIX ROTATING THE 'FROM' SYSTEM TO MEAN OF 1950.0 AND THE
C   VECTOR TRANSLATING THE ORIGIN FROM THE INPUT ORIGIN TO THE 
C   GEOCENTER.
C
      CALL CTPAK3A(KSPEC1(1),KSPEC1(2),ROTMX(1,1,1),
     *           SHIFT(1,1),NPARMS,PARMS(1,1),LUERR,IERR)
C
C   GET THE MATRIX ROTATING THE 'TO' SYSTEM TO MEAN OF 1950.0 AND THE 
C   VECTOR TRANSLATING THE ORIGIN FROM THE OUTPUT ORIGIN TO THE 
C   GEOCENTER.
C
      CALL CTPAK3A(KSPEC2(1),KSPEC2(2),ROTMX(1,1,2),
     *           SHIFT(1,2),NPARMS,PARMS(1,2),LUERR,IERR)
C
      RETURN
      END
